<template>
	<view class="p_input">
		<span class="label">
			{{label}}:
		</span>
		<!-- <view class="column"> -->
		<input class="input" :type="type" v-model="clone_value" :placeholder="placeholder" />
		<!-- </view> -->
	</view>
</template>

<script>
	export default {
		props: {
			label: String,
			type: String,
			placeholder: String,
			value: String
		},
		model: {
			prop: 'value', //指向props的参数名
			event: 'change' //事件名称
		},
		data() {
			return {
				clone_value: ''
			};
		},
		watch: {
			clone_value(v) {
				this.$emit('change', v)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.p_input {
		margin: 0 10px;
		margin-top: 10px;
		border-bottom: 1px solid #dddddd;
		display: flex;
		align-items: center;

		.input {
			flex: 1;
			text-align: right;
			padding: 10px 5px;
			margin-left: 10px;
			background: none;
			outline: none;
			border: none;
		}
	}
</style>
